package com.shtel.bss.saas.tenant.entity.repository.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shtel.bss.saas.tenant.entity.SysUser;
import com.shtel.bss.saas.tenant.entity.repository.ISysUserRepository;
import com.shtel.bss.saas.tenant.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * sys_user仓库现实类
 *
 * @author xiezhiwei 2020-02-05 21:21
 */
@Repository("sysUserRepository")
public class SysUserRepositoryImpl implements ISysUserRepository {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public PageInfo<SysUser> selectEntity(SysUser sysUser, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize, true);
        return new PageInfo(sysUserMapper.selectEntity(sysUser));
    }

    @Override
    public SysUser selectOne(SysUser sysUser) {
        return sysUserMapper.selectOne(sysUser);
    }

    @Override
    public SysUser selectByAccount(String account) {
        return sysUserMapper.selectByAccount(account);
    }
}